<template>
  <div id="mymenu">
    <el-row>
      <el-col :span="2">
        <div class="grid-content bg-purple"></div>
      </el-col>
      <el-col :span="12">
        <div class="grid-content bg-purple-light" id="menulog">
          <p class="hidden-md-and-down">谁不眷恋一茶一饭的光辉</p>
          <div class="menu_log">
            <input type="text" id="menu_search" placeholder="搜索菜谱/食材" v-model="menuvalue" />
            <input type="button" id="menu_btn" value="搜索" @click="search" />
          </div>
        </div>
      </el-col>
      <el-col :span="10">
        <div class="grid-content bg-purple"></div>
      </el-col>
    </el-row>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  data() {
    return {
      menuvalue: "",
      queryName: '',
    };
  },
  //menu本页面搜索
  methods:{
    search(){
      this.$router.push({name:'menusearch',params:{id:this.menuvalue}})
    } 
  },
  //钩子函数
  created() {
    this.queryName = this.$route.params.id;
    if(this.queryName != null){
      console.log(this.queryName)
      this.$router.push({name:'menusearch',params:{id:this.queryName}})
    }
  },

};
</script>
<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}

#mymenu {
  margin-top: 60px;
  list-style: none;
}

// #mymenu li {
//   float: left;
//   width: 100px;
//   height: 50px;
//   line-height: 50px;
//   font-size: 30px;
//   margin-left: 20px;
// }

#menulog {
  height: 400px;
  position: relative;
}

#menulog p {
  display: inline-block;
  font-size: 40px;
  color: #fff;
  line-height: 66px;
  text-shadow: 5px 3px 7px #94a4b2;
  position: absolute;
  top: 120px;
}

.menu_log {
  position: absolute;
  z-index: 9;
  bottom: 130px;
  height: 60px;
  width: 100%;
  border: 1px solid #eee;
  -webkit-box-shadow: 0 6px 12px 0 rgba(0, 0, 0, 0.08);
  box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  display: flex;
}

#menu_search {
  -webkit-box-flex: 1;
  flex: 1;
  padding: 19px 10px;
  margin-left: 10px;
  height: 22px;
  line-height: 22px;
  outline: none;
  overflow: hidden;
  border: 0;
  margin-top: 10px;
}

#menu_btn {
  cursor: pointer;
  flex: 0 74px;
  font-size: 17px;
  color: #fff;
  text-align: center;
  margin: 10px 20px;
  border-radius: 4px;
  background: #e6a23c;
  border: 0;
}
.el-row {
  background-image: url(http://v.bootstrapmb.com/2020/5/ukp9k8067/assets/img/cta-bg.jpg);
  background-size: cover;
  height: 400px;
  &:last-child {
    margin-bottom: 0;
  }
}
.el-col {
  border-radius: 4px;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
</style>

